//
//  GasUITableViewCell.m
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.

//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

#import "GasUITableViewCell.h"

@interface GasUITableViewCellView : UIView
@end

@implementation GasUITableViewCellView

- (void)drawRect:(CGRect)rectangle
{
	[(GasUITableViewCell *)[self superview] drawContentView:rectangle];
}

@end



@implementation GasUITableViewCell

- (id)initWithFrame:(CGRect)frame  {
    if(self = [super initWithFrame:frame ])
	{
		contentView = [[GasUITableViewCellView alloc] initWithFrame:CGRectZero];
		contentView.opaque = YES;
		[self addSubview:contentView];
		[contentView release];
    }
    return self;
}

- (void)dealloc
{
	[super dealloc];
}

- (void)setFrame:(CGRect)myFrame
{
	[super setFrame:myFrame];
	CGRect myBounds = [self bounds];
	myBounds.size.height -= 1; // leave room for the seperator line
	[contentView setFrame:myBounds];
}

- (void)setNeedsDisplay
{
	[super setNeedsDisplay];
	[contentView setNeedsDisplay];
}

- (void)drawContentView:(CGRect)retangle
{
	// subclasses should implement this
}

@end
